//blockstairs.txt - Stairs. When used, switches the party to the other layer.
//However, if a given SDF is nonzero, don't let them climb. Instead play some 
// dialogue.

//Cell 0,1 - Coords in the new layer to place the party at. If these values 
//  are left at 0, places the party at the location of this object.
// Cell 2 - Number of dialogue node to play is steps blocked.
// Cell 3 - Direction to place party in
	// direction - 0,1 - north 2,3 - west 4,5 - south 6,7 - east
// Cell 4,5 - A SDF. If nonzero, don't let them climb. instead play dialog.

beginobjectscript; 

variables;

short got_warning = 0;

body;

beginstate INIT_STATE;
	break;

beginstate DEAD_STATE;
	break;

beginstate START_STATE; 
	break;

beginstate USE_STATE;
	if (is_combat()) {
		print_str_color("Climb: You can't change levels when in combat.",1);
		end();
		}
	if (gf(get_memory_cell(4),get_memory_cell(5)) != 0) {
		begin_talk_mode(get_memory_cell(2));
		end();
		}
		
	if (get_memory_cell(0) != 0)
		change_level(get_memory_cell(0),get_memory_cell(1),get_memory_cell(3));
		else change_level(my_loc_x(),my_loc_y(),get_memory_cell(3));
break;
